﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="LdapSkupineUvoz.aspx.cs" Inherits="Sio.Mdm.Web.Instalacija.LdapSkupineUvoz" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title></title>
    
    <style type="text/css">
        .cbExtended-list 
        {
            width: 398px;
            font: 11px tahoma,arial,helvetica,sans-serif;
        }
        
        .cbExtended-list th {
            font-weight: bold;
        }
        
        .cbExtended-list td, .cbExtended-list th {
            padding: 3px;
        }
                             
        .cbOrgarnizacija-backgr {
            background: #D1DDEF;
            border-top: 1px dotted #B5B8C8;
            border-bottom: 1px dotted #B5B8C8;              
            padding-top:5px;
            padding-bottom:5px;         
        }    
    </style>
    
</head>
<body>
    <form id="form1" runat="server">
    <ext:ResourceManager ID="ResourceManager1" runat="server" />
    
    <ext:Store ID="StoreOrgarnizacije" runat="server">
	<Reader>
		<ext:JsonReader IDProperty="OrganizacijaId">
			<Fields>
				<ext:RecordField Name="OrganizacijaId" Type="Int" />
				<ext:RecordField Name="Naziv" Type="String" />
			</Fields>
		</ext:JsonReader>
	</Reader>
    </ext:Store>
    
    <ext:Store ID="StoreStrezniki" runat="server">
	<Reader>		
        <ext:JsonReader IDProperty="LdapStreznikID">
            <Fields>
                <ext:RecordField Name="LdapStreznikID" Type="Int" />                        
                <ext:RecordField Name="Ime" Type="String" />
                <ext:RecordField Name="Opis" Type="String" />                                                                                              
            </Fields>
        </ext:JsonReader>
    </Reader>		
    </ext:Store>       
    
    <ext:Viewport ID="Viewport1" runat="server" Layout="Fit">
        <Content>
        
            <ext:Panel 
            ID="PanelMain"
            runat="server"             
            HideBorders="true"                        
            PaddingSummary="5px 5px 0"                        
            Frame="true"
            ButtonAlign="Center"
            ActiveIndex="0"            
            Layout="Card">
            <Items>
            
                <ext:Panel ID="PanelStep1" runat="server" HideBorders="true" PaddingSummary="0px 0px 0" Frame="false" Layout="Form">
                <Items>
                    <ext:Label runat="server" Html="<b>Korak 1:</b> Izberite strežnik in podajte DN pot za uvoz skupin <br><br>" HideLabel="true"/>
                    
                    <ext:ComboBox ID="cmbOrgarnizacije" FieldLabel="Organizacija" EmptyText="Izberi organizacijo..." runat="server" Editable="false" SelectOnFocus="true"
                    Width="200" StoreID="StoreOrgarnizacije" DisplayField="Naziv" ValueField="OrganizacijaId" AllowBlank="false" ItemCls="cbOrgarnizacija-backgr">				    		
			        <DirectEvents>			    
			            <Select OnEvent="OnOrgarnizacijaChanged"></Select>
			        </DirectEvents>
			        </ext:ComboBox>
                    
                    <ext:ComboBox ID="cmbStreznik" runat="server" FieldLabel="Streznik" EmptyText="Izberi streznik" Width="200" TypeAhead="true" ForceSelection="true" StoreID="StoreStrezniki"
                    DisplayField="Ime" ValueField="LdapStreznikID" MinChars="1" ListWidth="400" ItemSelector="tr.list-item">
                    <Template ID="Template1" runat="server">
                    <Html>
					    <tpl for=".">
						    <tpl if="[xindex] == 1">
							    <table class="cbExtended-list">
								    <tr>
									    <th>Streznik</th>
									    <th>Opis</th>
								    </tr>
						    </tpl>
						    <tr class="list-item">
							    <td style="padding:3px 0px;">{Ime}</td>
							    <td>{Opis}</td>
						    </tr>
						    <tpl if="[xcount-xindex]==0">
							    </table>
						    </tpl>
					    </tpl>
				    </Html>
                    </Template>                
                    </ext:ComboBox>
                
                    <ext:TextField ID="txtDN" runat="server" FieldLabel="pot DN" AllowBlank="false" Width="300" />
                    
                    <ext:Label ID="lblWarning" runat="server" Text="Warning..." Icon="Error" Hidden="true"/>
                    
                </Items>                     
                </ext:Panel>                                      
                
                <ext:Panel ID="PanelPreview" runat="server" HideBorders="true" PaddingSummary="0px 0px 0" Frame="false" Layout="Form" Hidden="true">
                <Items>
                    <ext:Label ID="Label2" runat="server" Html="<b>Korak 2:</b> Pregled stanja podatkov<br><br>" HideLabel="true"/> 
                    <ext:Label ID="lblInfo" runat="server" Html="" HideLabel="true"/> 
                    <ext:Label ID="lblInfo2" runat="server" Html="<i>Opozorilo: na tem mestu ni na voljo skupin, ki bi jih lahko uvozili.</i>" HideLabel="true" Hidden="true" Icon="Exclamation" IconAlign="Left"/>                  
                </Items>                     
                </ext:Panel>
                                
                <ext:Panel ID="Panel1" runat="server" HideBorders="true" PaddingSummary="0px 0px 0" Frame="false" Layout="Form" Hidden="true">
                <Items>
                    <ext:Label ID="Label3" runat="server" Html="<b>Korak 3:</b> Izberite skupine, ki jih želite uvoziti <br><br>" HideLabel="true"/>                                        
                    <ext:GridPanel ID="GridSkupineSeznam" runat="server" StripeRows="true" TrackMouseOver="true" AutoExpandColumn="Description" AutoScroll="true">                
                <Store>
                    <ext:Store ID="StoreSkupineSeznam" runat="server">
			            <Reader>
				            <ext:ArrayReader IDProperty="DN">
					            <Fields>
						            <ext:RecordField Name="CN" Type="String" />
						            <ext:RecordField Name="DN" Type="String" />
						            <ext:RecordField Name="Description" Type="String" />						            
					            </Fields>
				            </ext:ArrayReader>
			            </Reader>
		            </ext:Store>                    
                </Store>
                <ColumnModel ID="ColumnModel1" runat="server">
                    <Columns>
                        <ext:RowNumbererColumn />
                        <ext:Column ColumnID="CN" Hidden="false" Hideable="false" DataIndex="CN" Header="CN">
                        </ext:Column>                        
                        <ext:Column ColumnID="DN" Hidden="false" Hideable="false" DataIndex="DN" Header="DN" Width="200">
                        </ext:Column>  
                        <ext:Column ColumnID="Description" Hidden="false" Hideable="false" DataIndex="Description" Header="Opis">
                        </ext:Column>                                                                                                        
                    </Columns>
                </ColumnModel>
                <SelectionModel>
                    <ext:CheckboxSelectionModel ID="CheckboxSelectionModel1" runat="server" />
                </SelectionModel>
                </ext:GridPanel>
                </Items>                     
                </ext:Panel>
                                                     
                <ext:Panel ID="PanelSuccess" runat="server" HideBorders="true" PaddingSummary="0px 0px 0" Frame="false" Layout="Form" Hidden="true">
                <Items>
                    <ext:Label ID="Label1" runat="server" Html="<b>Uvoz podatkov je uspešno zaključen</b> <br><br>" HideLabel="true"/> 
                    <ext:Label ID="lblSuccess" runat="server" Html="" HideLabel="true"/>                   
                </Items>                     
                </ext:Panel>     
                       
                <ext:Panel ID="PanelError" runat="server" HideBorders="true" PaddingSummary="0px 0px 0" Frame="false" Layout="Form" Hidden="true">
                <Items>
                    <ext:Label ID="lblErrorDesc" runat="server" Html="<b>Napaka:</b> Prišlo je do napake !!  <br><br>" HideLabel="true"/> 
                    <ext:Label ID="lblError" runat="server" Html="" HideLabel="true"/>                   
                </Items>                     
                </ext:Panel> 
                         
            </Items>
            
            <BottomBar>
                <ext:StatusBar 
                    ID="StatusBar1" 
                    runat="server"
                    DefaultText="status">
                    <Items>
                        <ext:ToolbarTextItem ID="ToolbarTextItem2" runat="server" Text="Operacija" />                        
                        <ext:ToolbarSeparator ID="ToolbarSeparator1" runat="server" />
                        <ext:Button ID="btnPrevious" runat="server" Text="Nazaj" Icon="PreviousGreen">
                            <DirectEvents>
                                <Click OnEvent="PreviousClicked" Before="#{btnPrevious}.disable();#{btnNext}.disable();">
                                </Click>
                            </DirectEvents>
                        </ext:Button>
                        <ext:ToolbarSeparator ID="ToolbarSeparator2" runat="server" />
                        <ext:Button ID="btnNext" runat="server" Text="Naprej" Icon="NextGreen">
                            <DirectEvents>
                                <Click OnEvent="NextClicked" Before="#{btnPrevious}.disable();#{btnNext}.disable();#{StatusBar1}.showBusy('Prosimo počakajte...');">
                                <ExtraParams>
                                    <ext:Parameter Name="selected" Mode="Raw" Value="Ext.encode(#{GridSkupineSeznam}.getRowsValues({selectedOnly:true}))" />
                                </ExtraParams>
                                </Click>
                            </DirectEvents>
                        </ext:Button>
                    </Items>                                                           
                </ext:StatusBar>
            </BottomBar>           
            </ext:Panel>
                
        </Content>
    </ext:Viewport>
    
    <sio:DialogProxy runat="server" ID="LdapStreznikPodrobnoProxy" WindowId="DialogSkupineUvoz">
	<DirectEvents>		
		<ButtonClicked OnEvent="ButtonClicked">
		<ExtraParams>
			<ext:Parameter Name="button" Value="item.id" Mode="Raw" />
		</ExtraParams>
		</ButtonClicked>		
	</DirectEvents>
	</sio:DialogProxy>
    
    </form>
</body>
</html>
